package jrain.fw.script.operator;

import jrain.fw.script.tools.ELException;
import jrain.fw.script.tools.Logger;

//大于
public class GreaterThanOperator extends RelationalOperator {

	public static final GreaterThanOperator SINGLETON = new GreaterThanOperator();

	public GreaterThanOperator() {
	}

	public String getOperatorSymbol() {
		return ">";
	}

	public Object apply(Object pLeft, Object pRight, Object pContext, Logger pLogger) throws ELException {
		if (pLeft == pRight) {
			return Boolean.FALSE;
		} else if (pLeft == null || pRight == null) {
			return Boolean.FALSE;
		} else {
			return super.apply(pLeft, pRight, pContext, pLogger);
		}
	}

	public boolean apply(double pLeft, double pRight, Logger pLogger) {
		return pLeft > pRight;
	}

	public boolean apply(long pLeft, long pRight, Logger pLogger) {
		return pLeft > pRight;
	}

	public boolean apply(String pLeft, String pRight, Logger pLogger) {
		return pLeft.compareTo(pRight) > 0;
	}

}
